home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.tcl,comp.lang.c,comp.lang.c++,comp.databases.sybase,comp.databases.oracle,comp.databases.informix,comp.databases.oracle
- Path: news.luc.edu!uchinews!news
- From: Charles Fiterman <cef@geodesic.com>
- Subject: Re: realloc equivalent in C++
- X-Nntp-Posting-Host: ford.uchicago.edu
- Message-ID: <DMo0t0.J1z@midway.uchicago.edu>
- Sender: news@midway.uchicago.edu (News Administrator)
- Organization: Geodesic Systems
- References: <4fecgc$ar9@engr.orst.edu> <DMJ15v.13C@falcon.daytonoh.attgis.com> <4fgir1$pri@theory.tc.cornell.edu>
- Date: Mon, 12 Feb 1996 13:43:48 GMT
-
- In article <4fgir1$pri@theory.tc.cornell.edu>,
- Honbo Zhou <hzhou@r26n05.tc.cornell.edu> wrote:
- >Is there anything in C++ equvalent to realloc in C which can be used
- >to increase allocated memory? Can't find this even in C++ books which
- >talk about memory management specifically. Thanks. Honbo
-
- Realloc is one of C's mistakes. It assimes that the realloc()ed memory
- can be moved bitwise. In C++ this is often false. C++ objects often
- contain self pointers or are the targets of numerous outside pointers.
- So you need a realloc for each object type that invokes destructors
- and constructors to move things. It might be doable with templates.
-
-
-